/*
 * SonarQube
 * Copyright (C) 2009-2017 SonarSource SA
 * mailto:info AT sonarsource DOT com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
@import (reference) "../variables";
@import (reference) "../mixins";


// Base

.link-variant(@baseColor, @hoverColor, @borderColor) {
  border-bottom: 1px solid @borderColor;
  color: @baseColor;
  
  &:hover, &:active, &:focus { color: @hoverColor; }
}

a {
  .link-variant(@darkBlue, @blue, @lightBlue);
  cursor: pointer;
  outline: none;
  text-decoration: none;
  transition: all 0.2s ease;
}

.link-base-color {
  .link-variant(@baseFontColor, @blue, mix(@baseFontColor, @barBackgroundColor, 20%));

  &:hover { border-bottom-color: @lightBlue; }
  &:active, &:focus { border-bottom-color: @lightBlue; }
}


.tooltip a { color: @lightBlue; }


// Misc

.link-no-underline { border-bottom: none; }
.link-underline { border-bottom: 1px solid #cae3f2 !important; }

.link-with-icon { border-bottom: none; }
.link-with-icon > span:last-child { border-bottom: 1px solid @lightBlue; }

a.active-link,
.link-active {
  .link-no-underline;
  cursor: default;
}


// Color

.link-red, /* deprecated */
a.text-danger  { .link-variant(@red,             darken(@red, 10%),             lighten(@red, 40%)); }
a.text-muted   { .link-variant(@secondFontColor, darken(@secondFontColor, 10%), lighten(@secondFontColor, 40%)); }
a.text-warning { .link-variant(@orange,          lighten(@orange, 10%),         lighten(@orange, 40%)); }
a.text-info    { }
a.text-success { .link-variant(@green,           darken(@green, 10%),           lighten(@green, 40%)); }
